#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main() {
    int n, a[50], x;
    while (~scanf("%d", &n)) {
        for (int i = 0; i < n; i++)
            scanf("%d", &a[i]);
        scanf("%d", &x);
        for (int i = 0; i < n; i++)
            if (a[i] != x) printf("%d ", a[i]);
    }
}